/* 
 * File:   EntityComponent.h
 * Author: RedEyedKiller
 *
 * Created on 23 Σεπτέμβριος 2010, 1:36 πμ
 */

#ifndef ENTITYCOMPONENT_H
#define	ENTITYCOMPONENT_H

#include "EntityComponentTypes.h"

namespace EntitySystem
{

class Entity;
union GameEvent;

namespace components
{

/**
 * This is the root of all EntityComponents. Provides the required interfece
 * in order to handle events.
 */
class EntityComponent
{
public:

    EntityComponent(){}
    virtual ~EntityComponent(){}
    /**
     * @return The type of this component.
     */
    virtual ENTCOMP_TYPES GetType() = 0;

    /**
     *
     * @return a new instance of the specific subtype of EntityComponent.
     */
    virtual EntityComponent* Clone() = 0;
    
    inline void SetParent(Entity* parent)
    {
        this->parent = parent;
    }

    inline Entity* GetParent() const
    {
        return parent;
    }
protected:
    Entity* parent;//the entity this Component is attached to.
};

};
};
#endif	/* ENTITYCOMPONENT_H */
